import { request } from '../fetch'
import URL from './base'

export const getAllFeed = async (cursor = '1'): Promise<unknown[]> => {
  const [e = null, r] = await request<unknown[]>({
    url: URL.BASE + URL.GET_ALL_FEED,
    method: 'POST',
    params: {
      aid: process.env.VITE_APP_BASE_AID,
      uuid: process.env.VITE_APP_BASE_UUID,
      spider: '0'
    },
    data: {
      id_type: 2,
      client_type: 2608,
      sort_type: 200,
      cursor,
      limit: 20
    }
  })
  if (e) return []
  return r?.data as unknown[]
}
